import { Entity, PrimaryGeneratedColumn, Column, Index } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("skill_upgrade_thresholds")
@ManualTimestamp()
@Index(["skillName", "nextGrade"], { unique: true })
export class SkillUpgradeThresholdEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ type: "varchar", length: 100, comment: "技能名称" })
  skillName!: string;

  @Column({ type: "int", comment: "要升级到的目标等级(2-5)" })
  nextGrade!: number;

  @Column({ type: "int", comment: "所需熟练度" })
  requiredProficiency!: number;

  @Column("datetime", { name: "created_at", comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", {
    name: "updated_at",
    nullable: true,
    comment: "更新时间",
  })
  updated_at!: Date | null;
}
